<%--
  Created by IntelliJ IDEA.
  User: 12
  Date: 2023/3/2
  Time: 15:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<style>
    .table{
        text-align: center;
    }
</style>
<head>
    <title>商品列表</title>
    <%--引入webjars--%>
    <script src="/webjars/jquery/3.6.0/jquery.min.js"></script>
    <link rel="stylesheet" href="/webjars/bootstrap/3.4.1/css/bootstrap.min.css">
    <script src="/webjars/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
    <div class="container">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">
                    <h3>商品列表信息</h3>
                </h3>
            </div>
            <table class="table">
                <tr>
                    <td>商品ID</td>
                    <td>商品名称</td>
                    <td>商品单价</td>
                    <td>商品库存</td>
                    <td>是否挑选</td>
                </tr>
                <c:forEach var="p" items="${products}">
                <tr>
                    <td>${p.value.pid}</td>
                    <td>${p.value.pname}</td>
                    <td>${p.value.price}</td>
                    <td>${p.value.quantity}</td>
                    <td>
                        <a href="/cart?cmd=add&pid=${p.value.pid}" class="btn btn-success btn-sm">挑选</a>
                    </td>
                </tr>
                </c:forEach>
            </table>
            <div class="panel-footer text-right">
                百年智的商品
            </div>
        </div>
    </div>
</body>
</html>
